import { IFeidaoAiBrowserComponent } from '@dfeidao/atom-web/interfaces';
import get from '@dfeidao/atom-web/local/get';
import fire from '@dfeidao/atom-web/msg/fire';

export default async function a003(fd: IFeidaoAiBrowserComponent) {// 删除按钮
	// todo
	console.log('zj-000006:a003------start');
	const list_chk = fd.data.node.querySelectorAll('[data-id="list1"]:checked');// 获取选择要删除的数据节点
	const list = Array.from(list_chk) as HTMLInputElement[];// 将伪数组转化为数组
	const no = get(fd, 'no1') as string;
	if (list.length === 0) {// 没有要删除的数据
		alert('请选择至少一列数据');
	} else {
		const nos = list.map((n) => {
			return n.getAttribute("data-no");
		});// 获取要删除的数据编号
		fire('zj-000011', 'a001', [no], nos);// 弹出删除弹框
	}
	console.log('zj-000006:a003------end');

}
